﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GlassStore.ViewModels.GlassBrowseViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    眼镜列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div align="center">
        <h2>
            眼镜列表</h2>
        <table>
            <tr>
                <th>
                </th>
                <th>
                    名称
                </th>
                <th>
                    品牌
                </th>
                <th>
                    材质
                </th>
                <th>
                    类别
                </th>
                <th>
                    型号
                </th>
                <th>
                    价格
                </th>
                <th>
                    描述
                </th>
                <th>
                    缩略图
                </th>
            </tr>
            <% foreach (var item in Model.Glasses)
               { %>
            <tr>
                <td>
                    <%: Html.ActionLink("编辑", "Edit", new { id=item.GlassId }) %>
                    |
                    <%: Html.ActionLink("详情", "Details", new { id=item.GlassId })%>
                    |
                    <%: Html.ActionLink("删除", "Delete", new { id=item.GlassId })%>
                </td>
                <td>
                    <%--<%: Html.Truncate(item.GlassName,20) %>--%>
                    <%: item.GlassName %>
                </td>
                <td>
                    <%: item.Brand %>
                </td>
                <td>
                    <%: item.Material %>
                </td>
                <td>
                    <%: item.Style %>-<%: item.StyleDetail %>
                </td>
                <td>
                    <%: item.Serial %>
                </td>
                <td>
                    <%: String.Format("{0:F}", item.Price) %>
                </td>
                <td>
                    <%: Html.Truncate(item.Description,20) %>
                </td>
                <td>
                    <img src="<%:item.ThumbnailSmall %>" alt="没有图片" width="80" height="80" /><br />
                </td>
            </tr>
            <% } %>
            <tr>
                <td>
                    <div id="glass-list-pager">
                        <%: MvcHtmlString.Create(Html.Pager(Model.Index, Model.Total, string.Format("/GlassManager?id=")))%></div>
                </td>
            </tr>
        </table>
        <p>
            <%: Html.ActionLink("添加", "Create") %>|
            <%: Html.ActionLink("返回", "Index", "Manager") %>
        </p>
    </div>
</asp:Content>
